<template>
	<view class="mini-card">
		<view class="card-item" v-for="(item,i) in miniCartList" :key="i" @tap.stop="$Router.push({path: '/pages/goods/goods_detail', query: {from: 'mini'}})">
			<view class="img">
				<image class="left-img" :src="item.image + ''" mode=""></image>
			</view>
			<view class="right-content">
				<view class="title">{{item.title}}</view>
				<view class="num">仅剩{{item.num}}件</view>
				<view class="price-btn">
					<view class="price">
						<view class="icon">￥</view>
						<view class="money">{{item.money}}</view>
					</view>
					
					<view class="btn">
						<image class="img_" src="../../static/img/btn-bj.png" mode=""></image>
						<view class="text_1">立即抢购</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "t-mini-card",
		props: {
			// miniCartList: {}
			
		},
		data() {
			return {
				miniCartList: [{
						title: '2022夏季女装甜美方领蝴蝶结2022夏季女装甜美方领蝴蝶结',
						num: 9,
						money: 188,
						image: "../../static/img/goods_1.png"
					},
					{
						title: '2022夏季女装甜美方领蝴蝶结2022夏季女装甜美方领蝴蝶结',
						num: 10,
						money: 199,
						image: '../../static/img/goods_2.png'
					}
				]
			};
		}
	}
</script>

<style lang="scss">
	.mini-card {
		margin: 20rpx 18rpx 20rpx 18rpx;
		.card-item {
			background-color: #fff;
			border-radius: 10rpx;
			overflow: hidden;
			display: flex;
			overflow: hidden;
			margin-bottom: 20rpx;
			&:last-child {
				margin-bottom: 0;
			}
			.img {
				width: 200rpx;
				height: 200rpx;
				margin-right: 28rpx;
				background-color: #ccc;
				.left-img {
					width: 100%;
					height: 100%;
				}
			}

			.right-content {
				height: 100%;
				width: 65%;

				.title {
					width: 368rpx;
					font-size: 24rpx;
					font-weight: bold;
					letter-spacing: 1rpx;
					color: #333333;
					overflow: hidden;
					white-space: nowrap;
					text-overflow: ellipsis;
					margin-top: 29rpx;
				}

				.num {
					font-size: 20rpx;
					letter-spacing: 2rpx;
					color: #989898;
					margin: 30rpx 0 10rpx 0;
				}

				.price-btn {
					display: flex;
					justify-content: space-between;
					align-items: center;

					.price {
						display: flex;
						align-items: center;

						.icon {
							font-weight: bold;
							font-size: 24rpx;
							letter-spacing: 2rpx;
							color: #ff0000;
						}

						.money {
							font-size: 30rpx;
							font-weight: bold;
							letter-spacing: 1rpx;
							color: #ff0000;
						}
					}

					.btn {
						position: relative;
						display: flex;
						align-items: center;
						padding-left: 15rpx;
						width: 160rpx;
						height: 51rpx;

						.img_ {
							width: 100%;
							height: 100%;
						}

						.text_1 {
							position: absolute;
							left: 30rpx;
							top: 50%;
							transform: translateY(-50%);
							font-size: 22rpx;
							color: #ffffff;
						}
					}
					.btn__ {
						.img__ {
							width: 40rpx;
							height: 40rpx;
						}
					}
				}
			}
		}
	}
</style>
